<template>
  <div id="XhGui">
       <!--    导航栏 -->
         <van-nav-bar
            title="鲜活投放柜"
            left-arrow
            :fixed=true
            :border=true
            @click-left="$router.go(-1)"
         ></van-nav-bar>
         <div style="margin-top:3rem;">

            <van-cell-group>
              <van-field label="编号" :value="bianhao" readonly />
              <van-field label="密码" :value="password" readonly />
            </van-cell-group>
              <div style="margin: 16px;">
                <van-button round block type="primary" @click="onSubmit()">
                   申请换柜
                </van-button>
              </div>
         </div>
  </div>
</template>

<script>
import { DatetimePicker, NoticeBar ,Toast} from 'vant'
import { getXH } from './../../../../service/api/index.js'
import {mapState,mapMutations} from 'vuex'
  export default{
     name:"XhGui",
     data(){
         return{
            bianhao:'',
            password:''
         }
     },
      
      mounted(){

      },
      created(){
            // console.log(this.userInfo.uid);
                getXH(this.userInfo.uid).then((response)=>{
                   console.log(response);
                  if (response.success) {
                        this.bianhao=response.bianhao;
                       this.password=response.mima;
                      // console.log(this.user);
                  }
                }).catch(error=>{
                    // todo......
                    console.log(error);
               })   //---catch
        }, // ----created
      computed:{
          ...mapState(["userInfo"]),

     },
     methods:{

        },

          
}
</script>


<style lang="less" scoped>
     #XhGui{
      position:fixed;
      top:0;
      left:0;
      bottom:0;
      right:0;
      background-color:#f5f5f5;
      z-index:200;
      overflow-y: scroll;

     }


    .router-slider-enter-active,.router-slider-leave-active{
      transition:all 0.3s;
    }

    .router-slider-enter,.router-slider-leave-active{
      transform:translate3d(2rem,0,0);
      opacity:0;
    }
</style>